

# $Id: signal_handlers.pl 24 2010-11-12 10:18:04Z dolbanavt@googlemail.com $
# $Date: 2010-11-12 12:18:19 +0200 (Птн, 12 Ноя 2010) $
# $HeadURL: https://tegusigalpa.googlecode.com/svn/branches/storage_init/signal_handlers.pl $
# $LastChangedRevision: 47 $

$SIG{'__DIE__'} = sub {
    utf8::decode( $_[0] ) unless utf8::is_utf8( $_[0] );

    container('log')->Fatal( $_[0] );

    container('log')->Note('terminating...') and exit( 1 );
};

$SIG{'__WARN__'} = sub {
    utf8::decode( $_[0] ) unless utf8::is_utf8( $_[0] );

    container('log')->Warn( $_[0] );
};

1;
